package com.cn.hibernate.base;

public class SubTableUtil {
	public static String strTablename_Userid(Integer places, String userid, String tablename) {
		if ((userid != null && !userid.equals("")) && (tablename != null && !tablename.equals(""))) {
			String subtable = "";
			Long userid_lon = Long.valueOf(userid);
			String userid_formst = String.format("%0" + places + "d", userid_lon);
			subtable = tablename + "_" + userid_formst.substring(userid_formst.length() - places);
			return subtable;
		} else {
			return null;
		}
	}
}
